import Vue from "vue";
import VueRouter from "vue-router";


import distribution from "../components/distribution/distributionList.vue"

import Login from "../views/Login.vue";
import Reg from "../views/Reg.vue";
import Info from "../views/Info.vue";
import StoresList from "../components/stores/StoresList.vue";
import AddStores from "../components/stores/AddStores.vue";
import EditStores from "../components/stores/EditStores.vue";
import StoresShopping from "../components/stores/StoresShopping.vue";

import Order from "../components/order/Order.vue";
import AddOrder from "../components/order/AddOrder.vue";
import addDistribution from "../components/distribution/addDistribution.vue";
import User from "../components/user/User.vue"
import AddUser from "../components/user/AddUser.vue"

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Login",
    component: Login,
    meta: { title: "登录" },
  },
  {
    path: "/reg",
    name: "Reg",
    component: Reg,
    meta: { title: "注册" },
  },
  {

    path: "/info",
    name: "Info",
    component: Info,
    children: [

      {
        path: "/info/goods",
        name: "goods",
        component: () =>
          import( "../components/shop-goods/index.vue"),
      },
      {
        path: "/info/addGoods",
        name: "addGoods",
        component: () =>
          import( "../components/shop-goods/addShopGoods.vue"),
      },

      { path: "storeList", name: "StoresList", component: StoresList },
      { path: "addStore", name: "AddStores", component: AddStores },
      { path: "editStores", name: "EditStores", component: EditStores },
      {
        path: "storesShopping",
        name: "StoresShopping",
        component: StoresShopping,
      },
      {
        path: "order",
        name: "order",
        component: Order,
      },
      {
        path: "AddOrder",
        name: "AddOrder",
        component: AddOrder,
      },
      {
        path: "/info/addDistribution",
        name: "addDistribution",
        component: addDistribution,
      }
      ,
      {
        path: "/info/distribution",
        name: "distribution",
        component: distribution,
      },
      {
        path: "/info/user",
        name: "User",
        component: User,
      },
      {
        path: "/info/addUser",
        name: "AddUser",
        component: AddUser,
      },
      
    ],

  },
 
];

const router = new VueRouter({
  routes,
});

export default router;
